package com.maolong.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.maolong.pojo.entity.Menu;
import com.maolong.pojo.vo.MenuNodeVo;
import com.maolong.pojo.vo.RoleMenuVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MenuMapper extends BaseMapper<Menu> {
    @Select("select * from menu")
    List<Menu> selectMenus();

    @Select("select id,menu_name name from menu where url is Null")
    List<MenuNodeVo> selectNodes();

    @Delete("delete from menu where id = #{id} or p_id =#{id}")
    void deleteWithPid(Integer id);

    @Select("select * from menu")
    List<RoleMenuVo> selectAll();
}
